<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"><HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">

<LINK REL="STYLESHEET" HREF="../book.css" CHARSET="ISO-8859-1" TYPE="text/css">
<title>Local history</title>

</HEAD>
<BODY BGCOLOR="#ffffff">
<h2>
Local history</h2>
<P CLASS="Para">
Every time you save an editable file in the workbench, the workbench updates the local history of that file and logs the changes that you have made to it. You can then access the local history of a file and revert to a
previously saved copy of the file, as long as the desired state is recent enough in the save history.</P>
<TABLE BORDER="0" cellspacing="0" cellpadding="3">
<THEAD>
</THEAD>
<TBODY>
<TR>
<TD valign="top" align="left">
<P CLASS="Para">
<b>
1.</b>
</P>
</TD>
<TD valign="top" align="left">
<P CLASS="Para">
Create a new file named sampleFile.txt</P>
</TD>
</TR>
<TR>
<TD valign="top" align="left">
<P CLASS="Para">
<b>
2.</b>
</P>
</TD>
<TD valign="top" align="left">
<P CLASS="Para">
In the editor for sampleFile.txt modify the resource by adding the line
&quot;change1&quot; and saving the file.</P>
</TD>
</TR>
<TR>
<TD valign="top" align="left">
<b>3.</b>
</TD>
<TD valign="top" align="left">
Repeat this by entering a new line &quot;change2&quot; and saving it again.
</TD>
</TR>
<TR>
<TD valign="top" align="left">
<b>4.</b>
</TD>
<TD valign="top" align="left">
Add
a third line &quot;change3&quot; and save it again.
</TD>
</TR>
<TR>
<TD valign="top" align="left">
<P CLASS="Para">
<b>5.</b>
</P>
</TD>
<TD valign="top" align="left">
<P CLASS="Para">
From the resource's context menu in the Navigator view, select Replace With &gt; Local History.</P>
</TD>
</TR>
<TR>
<TD valign="top" align="left">
<P CLASS="Para">
<b>6.</b>
</P>
</TD>
<TD valign="top" align="left">
<P CLASS="Para">The Replace from Local History dialog opens and shows the
previous local history&nbsp; of the file.</P>
<P CLASS="Para">&nbsp;<img align="texttop" border="0" src="../images/Image81_local.jpg" width="557" height="388"></P>
<P CLASS="Para">The left pane of the dialog contains the workbench's copy of the
file. In the figure below we can see the workbench contains the copy with all 3
lines - the same copy that is currently shown in the editor area of the
workbench.&nbsp;</P>
<P CLASS="Para">The first item in the local history (see below) contains the
last saved copy of the file. This is the one with only two lines of text. The
bottommost entry in the tree is the first copy of the file.</P>
<P CLASS="Para">The bottom area of the dialog allows us to see the differences
between the workbench file and the specific copy of the file selected in the
local history.&nbsp;&nbsp;</P>
</TD>
</TR>
<TR>
<TD valign="top" align="left">
<b>7.</b>
</TD>
<TD valign="top" align="left">
Select the first item (shown above) in the local history. The right pane should
show one line of text.&nbsp;
</TD>
</TR>
<TR>
<TD valign="top" align="left">
<P CLASS="Para">
<b>8.</b>
</P>
</TD>
<TD valign="top" align="left">
<P CLASS="Para">Click Replace. This replaces the workbench's copy of
sampleFile.txt with the chosen local history item.</P>
</TD>
</TR>
<TR>
<TD valign="top" align="left">
<P CLASS="Para">
<b>9.</b>
</P>
</TD>
<TD valign="top" align="left">
<P CLASS="Para">Observe that the sampleFile.txt editor now contains two
lines.&nbsp;</P>
</TD>
</TR>
</TBODY>
</TABLE>
<P>&nbsp;<br>
<img align="texttop" src = ../ngibmcpy.gif width="195" height="12">
</P>


</BODY>
</HTML>
